package com.hc.service.impl;

import com.hc.bean.AdminInfo;
import com.hc.dao.AdminInfoDao;
import com.hc.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminInfoDao adminInfoDao;

    @Override
    public Boolean isAdmin(String name) {
        if(adminInfoDao.isAdmin(name)>0){
            return true;
        }
        return false;
    }

    @Override
    public AdminInfo adminLogin(AdminInfo adminInfo) {
        AdminInfo admin=adminInfoDao.adminLogin(adminInfo);
        if(admin!=null){
            return admin;
        }
        return null;
    }

    @Override
    public List<AdminInfo> getAdminInfo() {
        return adminInfoDao.getAdminInfo();
    }
    /*管理员是否存在*/


}
